package com.hmdp.ThreadUtil.queuedemo;/**
 * @Author:fengxiaohui
 * @Description:
 * @Date:Create in 10:16 下午 2023/6/7
 * @Modified By:
 */

import org.springframework.web.servlet.mvc.method.annotation.PathVariableMapMethodArgumentResolver;

import java.util.concurrent.ArrayBlockingQueue;

/**
 *@Author:fengxiaohui
 *@Description:
 *@Date:Create in 10:16 下午 2023/6/7
 *@Modified By:
 */
public class BlockingQueueDemo {

   public static void main(String[] args) {
      new BlockingQueueDemo().testException();
   }

   //1、抛出异常
   public void testException(){
      ArrayBlockingQueue queue = new ArrayBlockingQueue<>(3);
      System.out.println(queue.add("a"));
      System.out.println(queue.add("b"));
      System.out.println(queue.add("c"));

   }
}
